<template>
  <div class="more-action">
    <!-- 状态一 -->
    <van-cell-group v-if="!isReport">
      <van-cell @click="disLike">不感兴趣</van-cell>
      <van-cell is-link @click="isReport =true">反馈垃圾内容</van-cell>
      <van-cell>拉黑作者</van-cell>
    </van-cell-group>
    <!-- 状态二 反馈-->
    <van-cell-group v-else>
      <van-cell icon="arrow-left" @click="isReport=false">返回</van-cell>
      <van-cell
        v-for="item in reportsList"
        :key="item.value"
        @click="report(item.value)"
        >{{item.label}}</van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import ReportsList from '@/constant/reports'
export default {
  name: 'MoreAction',
  data () {
    return {
      isReport: false, // 是否是处于状态二：反馈
      reportsList: ReportsList // 存放所有反馈的数据
    }
  },
  methods: {
    // 触发不感兴趣
    disLike () {
      this.$emit('dis-like')
    },
    // 触发反馈
    report (type) {
      this.$emit('report', type)
    }
  }
}
</script>

<style lang='less' scoped>
.more-action {
  border-radius: 4px;
}
</style>
